import chardet

file_path = r"C:\Users\Administrator\Desktop\ppt ceshi\glossary.csv"
with open(file_path, "rb") as f:
    raw_data = f.read()
    result = chardet.detect(raw_data)

print("检测到的编码：", result["encoding"])
print("置信度：", result["confidence"])